﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace XrayDirection.DAL.Migrations
{
    /// <inheritdoc />
    public partial class AddLotIdToOrders : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            // 添加新列
            migrationBuilder.AddColumn<string>(
                name: "LotId",
                table: "Orders",
                nullable: true,
                defaultValue: "");

            // 更新现有数据
            migrationBuilder.Sql("UPDATE Orders SET LotId = '' WHERE LotId IS NULL");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {

        }
    }
}
